// components/authorModal/authorModal.js
const app = getApp();

var common = require("../../common/common.js").common;

const defaultData = {
    authorIsShow: false
};

Component({
    /**
   * 组件的属性列表
   */
    properties: {
        title: {
            type: String
        },
        privacyAlert: {
            type: Boolean
        }
    },
    /**
   * 组件的初始数据
   */
    data: {},
    /**
   * 组件的方法列表
   */
    methods: {
        handleAgreePrivacyAuthorization() {
            if (this.resolvePrivacyAuthorization) {
                this.resolvePrivacyAuthorization({
                    buttonId: "agree-btn",
                    event: "agree"
                });
                this.resolvePrivacyAuthorization = null;
            }
            this.triggerEvent("close");
        },
        handleOpenPrivacyContract() {
            console.log(123);
            // 打开隐私协议页面
                        wx.openPrivacyContract({
                success: () => {},
                // 打开成功
                fail: () => {},
                // 打开失败
                complete: () => {}
            });
        },
        cancel() {
            if (this.resolvePrivacyAuthorization) {
                this.resolvePrivacyAuthorization({
                    event: "disagree"
                });
                this.resolvePrivacyAuthorization = null;
            }
            this.triggerEvent("close");
        }
    }
});